<script type="text/javascript" src="/scripts/tabsheets.js"></script>

    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main">
        <tr>
       
          <td width="64%"><h1><?=$title?></h1></td>
          <td width="32%" valign="middle">
          <div style="padding-top:3em">
            <a onclick="displ(&#039;d1&#039;)" id="dd1" class="active">Картинками</a>
            <a onclick="displ(&#039;d2&#039;)" id="dd2" class="inactive">Cписком</a>
          </div>
        </td>
      </tr>
    </table>



<table width="100%" border="0" cellpadding="0" cellspacing="0" class="main" style="margin-top:1.2em">
  <tr>

    
    <td valign="top">
    
    <div id="d1">
           <? foreach ($query->result() as $row){ 
                              
                     //Определяем цену/цены
              			$price=$this->Store_model->get_price($row->id); 
              
                    
                    ?>
           
                      <?if($this->uri->segment(3)== 'rods'){?>
                    
                      
                      
                      	<div>
                           <a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$level3?>/<?=$row->id?>/">
                              <div style="background: url(http://rybalka.com.ua/images/store/preview/<?=$row->id?>_1.jpg) no-repeat bottom; height:120px;width:950px ">
                           <? if($row->action == '1'){ ?>
                           <img src="/images/global/act.png">
                           <?}?>
                            </div></a>
                        </div>
                        
                            <div>
                                <small><?=$row->brand?> <a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$level3?>/<?=$row->id?>/"><?=$row->name?></a></small>
                             </div>
                             
                             <div>
                                 <small><?=$row->subhead?></small>
                              </div>
                            
                                          
                            <div style="margin-bottom:2em"><small>
                            <?if($price !=0)
                            
                                {echo "<b>$price грн</b>";}
                             else
                                {echo "<font color=\"gray\">Поставка ожидается</font>";}
                                
                            ?></small></div>

                     
                     <?}else{?>
           
           
             
	                
	                <div class="side">
	                	<a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$level3?>/<?=$row->id?>/">
	                        <div style="background: url(http://rybalka.com.ua/images/store/preview/<?=$row->id?>_1.jpg) no-repeat; height:200px;width:200px ">
	                        <? if($row->action == '1'){ ?>
	                        <img src="/images/global/act.png">
	                        <?}?>
	                        </div>
	                       </a>                     
	                      <div>
	                        <? if($row->brand == 'RM'){ echo "«Рыболовный мир»";}else{ echo $row->brand;}?> <a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$level3?>/<?=$row->id?>/"><nobr><?=$row->name?></nobr></a>
	                     </div>
	                      
	                      <div>
	                          <small><?=$row->subhead?></small>
	                       </div>
	                      
	                      <div>
	                         <? if($price !=0){echo "<b>$price грн</b>";}else{echo "<span class='gray'>Поставка ожидается</span>";} ?>                                  
	                      </div>
	                </div>
                
                <?}?>

          <? } ?>
    </div>
    
    
     <div id="d2" style="display:none;">
     <div style="padding-left:16%">
             <script type="text/javascript" src="/scripts/jquery.js"></script>
        <script type="text/javascript" src="/scripts/jquery.tablesorter.js"></script>
        <script type="text/javascript">
        $(function(){
          $("#catalog").tableSorter({
            sortClassAsc: 'headerSortUp', sortClassDesc: 'headerSortDown',
          headerClass: 'header' });
      })
      </script>
            
        <table id="catalog" cellspacing="0" width="60%" class="tablesorter">
          <thead>    
          <tr>
            <th>Модель</th>
            <th width="20%"><nobr>Цена, грн</nobr></th>
          </tr>
          </thead>
        
        <tbody>
          
          
          
          <? foreach ($query->result() as $row){ ?>
   
                     <?
  						$price=$this->Store_model->get_price($row->id); 
                    ?>
                    
          <tr>
          
              <td valign="top">
                <a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$level3?>/<?=$row->id?>/"><?=$row->name?></a> <?=$row->subhead?>
              </td>
          
           
            <td><?if($price !=0 || $price !="0—0"){echo "$price";}else{echo "<span style=\"color:white\">0</span>"; } ?></td>
          </tr> 
          
          
          
          <? } ?>
        </tbody>
        </table>
     
     </div>
     </div>
    
    
    </td>
  </tr>
</table>

